module.exports = function(sequelize, DataTypes) {
  var UserRelation = sequelize.define(
    'UserRelation',
    {
      relation: {
        type: DataTypes.ENUM('follow', 'mute', 'block')
      },
      notification: {
        type: DataTypes.ENUM('none', 'publish', 'all')
      }
    },
    {
      tableName: 'user_relation',
      indexes: [
        {
          name: 'relation_idx',
          fields: ['relation']
        },
        {
          name: 'notification_idx',
          fields: ['notification']
        }
      ],
      comments: '用户-用户关系连接表'
    }
  )

  return UserRelation
}
